package com.lyb.mvp.core;

/**
 * Created by lyb on 2017/7/27.
 * Email: 1373519715@qq.com
 * Blog: https://littleiii.github.io
 */
public class LPresent<V extends IView> implements IPresent<V> {
    private V v;

    @Override
    public void attachV(V view) {
        v = view;
    }

    @Override
    public void detachV() {
        v = null;
    }

    protected V getV() {
        if (v == null) {
            throw new IllegalStateException("v can not be null");
        }
        return v;
    }
}
